#include <windows.h>
#include <d3d8.h>
#include <d3dx8.h>
#include "ZenEngine.h"

class CSprite
{
private:
	CZenEngine	zen;
	
protected:
	int m_x;
	int m_y;
	int m_VelocityX;
	int m_VelocityY;

	BOOL m_bInitialized;
	
	D3DCOLOR m_ColorKey;

	CSprite * m_pNext;

	LPDIRECT3DSURFACE8	m_pSpriteSurface;
	LPDIRECT3DSURFACE8	m_pActiveSurface;

public:
	//members:
	int m_SurfaceWidth;
	int m_SurfaceHeight;
	int m_SpriteWidth;
	int m_SpriteHeight;
	int m_NumSprites;
	int m_State;

	BOOL m_bTransparent;

	//Con- & Destructors:
	CSprite();
	~CSprite();

	//Member-functions:
	HRESULT Initialize(char *, int, int, int);
	HRESULT Initialize(LPDIRECT3DSURFACE8, int, int, int);
	HRESULT SelectActiveSprite(int);
	HRESULT Render(LPDIRECT3DSURFACE8);

	void Shutdown();
	void SetColorKey(D3DCOLOR);
	void SetPosition(int, int);
	void GetPosition(int *, int *);
	void GetBounds(RECT *);
	void SetVelocity(int, int);
	void GetVelocity(int *, int *);
	void SetNext(CSprite *);
	void Update();

	D3DCOLOR GetColorKey();
	BOOL CheckForCollisionWith(CSprite *);
	CSprite * GetNext();
};
